home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vb-scr1a / mdi.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-09-10  |  11.1 KB  |  329 lines

  1. VERSION 2.00
  2. Begin MDIForm frmMDI 
  3.    Caption         =   "DSG VB-SCRIPT PAD"
  4.    ClientHeight    =   5415
  5.    ClientLeft      =   2190
  6.    ClientTop       =   2025
  7.    ClientWidth     =   7050
  8.    Height          =   6105
  9.    Left            =   2130
  10.    LinkTopic       =   "MDIForm1"
  11.    Top             =   1395
  12.    Width           =   7170
  13.    Begin PictureBox picToolbar 
  14.       Align           =   1  'Align Top
  15.       BackColor       =   &H8000000F&
  16.       Height          =   375
  17.       Left            =   0
  18.       ScaleHeight     =   345
  19.       ScaleWidth      =   7020
  20.       TabIndex        =   0
  21.       Top             =   0
  22.       Width           =   7050
  23.       Begin CommonDialog CMDialog1 
  24.          CancelError     =   -1  'True
  25.          Filter          =   "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
  26.          Left            =   5280
  27.          Top             =   240
  28.       End
  29.       Begin Image imgPasteButtonUp 
  30.          Height          =   330
  31.          Left            =   5280
  32.          Top             =   0
  33.          Visible         =   0   'False
  34.          Width           =   375
  35.       End
  36.       Begin Image imgPasteButtonDn 
  37.          Height          =   330
  38.          Left            =   4920
  39.          Top             =   0
  40.          Visible         =   0   'False
  41.          Width           =   375
  42.       End
  43.       Begin Image imgCopyButtonDn 
  44.          Height          =   330
  45.          Left            =   4200
  46.          Top             =   0
  47.          Visible         =   0   'False
  48.          Width           =   375
  49.       End
  50.       Begin Image imgCopyButtonUp 
  51.          Height          =   330
  52.          Left            =   4560
  53.          Top             =   0
  54.          Visible         =   0   'False
  55.          Width           =   375
  56.       End
  57.       Begin Image imgCutButtonDn 
  58.          Height          =   330
  59.          Left            =   3840
  60.          Top             =   0
  61.          Visible         =   0   'False
  62.          Width           =   375
  63.       End
  64.       Begin Image imgCutButtonUp 
  65.          Height          =   330
  66.          Left            =   3480
  67.          Top             =   0
  68.          Visible         =   0   'False
  69.          Width           =   375
  70.       End
  71.       Begin Image imgFileOpenButtonDn 
  72.          Height          =   330
  73.          Left            =   2760
  74.          Top             =   0
  75.          Visible         =   0   'False
  76.          Width           =   360
  77.       End
  78.       Begin Image imgFileOpenButtonUp 
  79.          Height          =   330
  80.          Left            =   3120
  81.          Top             =   0
  82.          Visible         =   0   'False
  83.          Width           =   360
  84.       End
  85.       Begin Image imgFileNewButtonUp 
  86.          Height          =   330
  87.          Left            =   2400
  88.          Top             =   0
  89.          Visible         =   0   'False
  90.          Width           =   360
  91.       End
  92.       Begin Image imgFileNewButtonDn 
  93.          Height          =   330
  94.          Left            =   2040
  95.          Top             =   0
  96.          Visible         =   0   'False
  97.          Width           =   375
  98.       End
  99.       Begin Image imgPasteButton 
  100.          Height          =   330
  101.          Left            =   1560
  102.          Top             =   0
  103.          Width           =   375
  104.       End
  105.       Begin Image imgCopyButton 
  106.          Height          =   330
  107.          Left            =   1200
  108.          Top             =   0
  109.          Width           =   375
  110.       End
  111.       Begin Image imgCutButton 
  112.          Height          =   330
  113.          Left            =   840
  114.          Top             =   0
  115.          Width           =   375
  116.       End
  117.       Begin Image imgFileOpenButton 
  118.          Height          =   330
  119.          Left            =   360
  120.          Top             =   0
  121.          Width           =   360
  122.       End
  123.       Begin Image imgFileNewButton 
  124.          Height          =   330
  125.          Left            =   0
  126.          Top             =   0
  127.          Width           =   360
  128.       End
  129.    End
  130.    Begin Menu mnuFile 
  131.       Caption         =   "&File"
  132.       Begin Menu mnuFNew 
  133.          Caption         =   "&New"
  134.       End
  135.       Begin Menu mnuFOpen 
  136.          Caption         =   "&Open"
  137.       End
  138.       Begin Menu mnuFExit 
  139.          Caption         =   "E&xit"
  140.       End
  141.       Begin Menu mnuRecentFile 
  142.          Caption         =   "-"
  143.          Index           =   0
  144.          Visible         =   0   'False
  145.       End
  146.       Begin Menu mnuRecentFile 
  147.          Caption         =   "RecentFile1"
  148.          Index           =   1
  149.          Visible         =   0   'False
  150.       End
  151.       Begin Menu mnuRecentFile 
  152.          Caption         =   "RecentFile2"
  153.          Index           =   2
  154.          Visible         =   0   'False
  155.       End
  156.       Begin Menu mnuRecentFile 
  157.          Caption         =   "RecentFile3"
  158.          Index           =   3
  159.          Visible         =   0   'False
  160.       End
  161.       Begin Menu mnuRecentFile 
  162.          Caption         =   "RecentFile4"
  163.          Index           =   4
  164.          Visible         =   0   'False
  165.       End
  166.    End
  167.    Begin Menu mnuOptions 
  168.       Caption         =   "&Options"
  169.       Begin Menu mnuOToolbar 
  170.          Caption         =   "&Toolbar"
  171.       End
  172.    End
  173. Sub imgCopyButton_Click ()
  174.     imgCopyButton.Refresh
  175.     EditCopyProc
  176. End Sub
  177. Sub imgCopyButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  178.     imgCopyButton.Picture = imgCopyButtonDn.Picture
  179. End Sub
  180. Sub imgCopyButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  181.     ' If the button is pressed, display the up bitmap if the
  182.     ' mouse is dragged outside the button's area, otherwise
  183.     ' display the up bitmap
  184.     Select Case Button
  185.     Case 1
  186.         If X <= 0 Or X > imgCopyButton.Width Or Y < 0 Or Y > imgCopyButton.Height Then
  187.             imgCopyButton.Picture = imgCopyButtonUp.Picture
  188.         Else
  189.             imgCopyButton.Picture = imgCopyButtonDn.Picture
  190.         End If
  191.     End Select
  192. End Sub
  193. Sub imgCopyButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  194.     imgCopyButton.Picture = imgCopyButtonUp.Picture
  195. End Sub
  196. Sub imgCutButton_Click ()
  197.     imgCutButton.Refresh
  198.     EditCutProc
  199. End Sub
  200. Sub imgCutButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  201.     imgCutButton.Picture = imgCutButtonDn.Picture
  202. End Sub
  203. Sub imgCutButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  204.     ' If the button is pressed, display the up bitmap if the
  205.     ' mouse is dragged outside the button's area, otherwise
  206.     ' display the up bitmap
  207.     Select Case Button
  208.     Case 1
  209.         If X <= 0 Or X > imgCutButton.Width Or Y < 0 Or Y > imgCutButton.Height Then
  210.             imgCutButton.Picture = imgCutButtonUp.Picture
  211.         Else
  212.             imgCutButton.Picture = imgCutButtonDn.Picture
  213.         End If
  214.     End Select
  215. End Sub
  216. Sub imgCutButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  217.     imgCutButton.Picture = imgCutButtonUp.Picture
  218. End Sub
  219. Sub imgFileNewButton_Click ()
  220.     imgFileNewButton.Refresh
  221.     FileNew
  222. End Sub
  223. Sub imgFileNewButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  224.     imgFileNewButton.Picture = imgFileNewButtonDn.Picture
  225. End Sub
  226. Sub imgFileNewButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  227.     ' If the button is pressed, display the up bitmap if the
  228.     ' mouse is dragged outside the button's area, otherwise
  229.     ' display the up bitmap
  230.     Select Case Button
  231.     Case 1
  232.         If X <= 0 Or X > imgFileNewButton.Width Or Y < 0 Or Y > imgFileNewButton.Height Then
  233.             imgFileNewButton.Picture = imgFileNewButtonUp.Picture
  234.         Else
  235.             imgFileNewButton.Picture = imgFileNewButtonDn.Picture
  236.         End If
  237.     End Select
  238. End Sub
  239. Sub imgFileNewButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  240.     imgFileNewButton.Picture = imgFileNewButtonUp.Picture
  241. End Sub
  242. Sub imgFileOpenButton_Click ()
  243.     imgFileOpenButton.Refresh
  244.     FOpenProc
  245. End Sub
  246. Sub imgFileOpenButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  247.     imgFileOpenButton.Picture = imgFileOpenButtonDn.Picture
  248. End Sub
  249. Sub imgFileOpenButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  250.     ' If the button is pressed, display the up bitmap if the
  251.     ' mouse is dragged outside the button's area, otherwise
  252.     ' display the up bitmap
  253.     Select Case Button
  254.     Case 1
  255.         If X <= 0 Or X > imgFileOpenButton.Width Or Y < 0 Or Y > imgFileOpenButton.Height Then
  256.             imgFileOpenButton.Picture = imgFileOpenButtonUp.Picture
  257.         Else
  258.             imgFileOpenButton.Picture = imgFileOpenButtonDn.Picture
  259.         End If
  260.     End Select
  261. End Sub
  262. Sub imgFileOpenButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  263.     imgFileOpenButton.Picture = imgFileOpenButtonUp.Picture
  264. End Sub
  265. Sub imgPasteButton_Click ()
  266.     imgPasteButton.Refresh
  267.     EditPasteProc
  268. End Sub
  269. Sub imgPasteButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  270.     imgPasteButton.Picture = imgPasteButtonDn.Picture
  271. End Sub
  272. Sub imgPasteButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  273.     ' If the button is pressed, display the up bitmap if the
  274.     ' mouse is dragged outside the button's area, otherwise
  275.     ' display the up bitmap
  276.     Select Case Button
  277.     Case 1
  278.         If X <= 0 Or X > imgPasteButton.Width Or Y < 0 Or Y > imgPasteButton.Height Then
  279.             imgPasteButton.Picture = imgPasteButtonUp.Picture
  280.         Else
  281.             imgPasteButton.Picture = imgPasteButtonDn.Picture
  282.         End If
  283.     End Select
  284. End Sub
  285. Sub imgPasteButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  286.     imgPasteButton.Picture = imgPasteButtonUp.Picture
  287. End Sub
  288. Sub MDIForm_Load ()
  289.     ' Application starts here (Load event of Startup form).
  290.     Show
  291.     ' Always set working directory to directory containing the application.
  292.     ChDir App.Path
  293.     'Initialize document form arrays, and show first document.
  294.     ReDim Document(1)
  295.     ReDim FState(1)
  296.     Document(1).Tag = 1
  297.     FState(1).Dirty = False
  298.     Document(1).Show
  299.     ' Read MDINOTE.INI and set recent file menu items appropriately
  300.     GetRecentFiles
  301. End Sub
  302. Sub MDIForm_Unload (Cancel As Integer)
  303.     ' If the Unload was not canceled (in the QueryUnload events for the Notepad forms)
  304.     ' there will be no document windows left, so go ahead and end the application.
  305.     If Not AnyPadsLeft() Then
  306.         End
  307.     End If
  308. End Sub
  309. Sub mnuFExit_Click ()
  310.     End
  311. End Sub
  312. Sub mnuFNew_Click ()
  313.     FileNew
  314. End Sub
  315. Sub mnuFOpen_Click ()
  316.     FOpenProc
  317. End Sub
  318. Sub mnuOptions_Click ()
  319.     mnuOToolbar.Checked = frmMDI!picToolbar.Visible
  320. End Sub
  321. Sub mnuOToolbar_Click ()
  322.     OptionsToolbarProc Me
  323. End Sub
  324. Sub mnuRecentFile_Click (index As Integer)
  325.   OpenFile (mnuRecentFile(index).Caption)
  326.   ' Update recent files list.
  327.   GetRecentFiles
  328. End Sub
  329.